<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>KIT ADMIN</title>
    <link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/plugins/build/css/app.css" media="all">
</head>
<style>
    .bg-f2{
        background-color: #F2F2F2;
    }
    .docinfo{
        display: block;
        float: right;
        color: #009688;
    }
    .docinfo:hover{
        color: #009688;
    }
    .docinfo i {
        font-size: 20px;
    }
    .layui-col-space15>*{
        padding: 3px;
    }
    .layui-card-header{
        color: #009688;
    }
</style>
<body>
<div class="container">
    <div class="layui-row layui-col-space15 module-info">

    </div>
</div>
<script src="/plugins/layui/layui.js"></script>
<script src="/plugins/common.js"></script>
<script>
    //所有模块
    var listUrl = SERVER_URL+"/moduleInfo/moduleOneLevelList";

    layui.use(['jquery', 'table', 'form','layer'], function() {
        var $ = layui.jquery;
        layer.config({
            anim: 5
            ,offset: '50px'
            ,maxmin: true
            ,isOutAnim: false,
            shade: [0.5, '#eee']
        })

        //初始化模块信息
        function initModuleInfo(data) {
            if(data){
                $(".module-info").html("");
                var str = "";
                for(var i in data){
                    console.log(data[i].moduleName)
                    str += "<div class=\"layui-col-xs3 bg-f2\"><div class=\"layui-card\"><div class=\"layui-card-header\"><i class=\"layui-icon\" style='margin-right: 5px;'>&#xe653;</i>";
                    str += data[i].moduleName;
                    str += "<a class=\"docinfo\" href=\"sub.html?moduleCode="+data[i].moduleCode+"&moduleName="+encodeURI(data[i].moduleName)+"\"><i class=\"layui-icon\">&#xe63c;</i></a>";
                    str += "</div>";
                    str += "<div class=\"layui-card-body\">标识：";
                    str += data[i].moduleCode;
                    str += "</div></div></div>";
                }
                $(".module-info").append(str);
            }
        }

        //获取所有模块信息
        layer.load(2, {time: 5*1000});
        $.ajax({
            type: 'GET',
            url: listUrl,
            success: function (result) {
                layer.closeAll();
                if(result.code == 20000){
                    initModuleInfo(result.data);
                }else{
                    layer.msg(result.msg, {time: 1500});
                }
            }
        });
    });
</script>
</body>
</html>